<?php

  include "DALstaff.php";

  //checks whether the password corresponds to the staffID.
  function validateStaff($staff_no, $password)
  {
    $staffPassword = getStaffPassword($staff_no);

    //if username does not exist or password does not correspond to the staffid, then return false
    //otherwiae, return true

    if($staffPassword == "")
    {
       echo "<SCRIPT language='Javascript'>";
       echo "  alert('The staff number does not exist.');";
       echo "</SCRIPT>";
       return false;
    }
    else if($staffPassword == $password)
    {
      return true;
    }
    else
    {
      echo "<SCRIPT language='Javascript'>";
      echo "  alert('Your password is incorrect.');";
      echo "</SCRIPT>";
      return false;
    }
  }

  function findDepNo($user)
  {

    return getDepartmentNo($user);

  }

?>